import { post } from "../utils/axios";
class Login {
  // 员工登录
	async login(data) {
    const res = await post("/offlinestore/user.login/login", {
      mobile: data.mobile,
      password: data.password
    });
    return res;
  }
  // 登陆后选择应用
  async selectApp() {
    const res = await post("/offlinestore/user.login/app_list", {
    });
    return res;
  }
  // 门店列表
  async selectRoom(data) {
    const res = await post("offlinestore/agent.store/index", {
      app_id: data,
    });
    return res;
  }
  // 获取角色权限
  async userRole(appid,id) {
    const res = await post("offlinestore/agent.Offlinerule/detail", {
      app_id: appid,
      id:id
    });
    return res;
  }
  // 代理注册
  async UserRegister(data) {
    const res = await post("api/index/register", data);
    return res;
  }
  // 发送验证码
  async sendRegisterCode(data) {
    const res = await post("api/index/send_code", data);
    return res;
  }
  // 初始化应用 app_id
  async initAppId(data) {
    const res = await post("api/application/init_app", {
      token: data,
      cate_id: 1
    });
    return res;
  }
  // 提交资料
  async submitRegister(data) {
    const res = await post("api/Agent_Data/submit", data);
    return res;
  }
  // 注册账号登陆
  async registerLogin(data) {
    const res = await post("api/index/login", data);
    return res;
  }
}

export default new Login;